#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int main()
{
//execl("/usr/bin/ls","ls","-l",NULL);
//execlp("ls","ls","-l",NULL);
//putenv("val=10");//将环境变量放入环境变量表
//char* const arr[]={"val1=100","val2=200",NULL};
//extern char** environ;
//execle("/home/lnb/linux-l/写博客-进程进程替换/childtest","./childtest",NULL,arr);
//char* const arr[]={"./childtest",NULL};
//execv("/home/lnb/linux-l/写博客-进程进程替换/childtest",arr);
char* const arr[]={"ls","-l",NULL};
char* const env[]={"val1=100","val2=200"};
 execvpe("ls",arr,env);
  printf("进程替换失败\n");

  return 0;
}
